<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        ul li {
            list-style: none;
        }
        a {
            text-decoration: none;
            padding-right: 10px;
        }
        ul li {
            float: left;
            padding: 10px;
            margin-left: -6px;
        }

    </style>
</head>
<body>
<h2>浮动实现导航栏的效果</h2>

<ul>
    <li><a href="https://www.baidu.com">百度网</a>|</li>
    <li><a href="https://www.sina.com">新浪网</a>|</li>
    <li><a href="https://www.tmall.com">天猫</a>|</li>
    <li><a href="https://www.taobao.com">淘宝</a></li>
</ul>
</body>
</html>